// pages/inner1/newhouse/newhouse.js

var utils = require('../../../utils/util.js') //这里说一下，这个util.js是配置的模块函数，再用的地方需要导入

Page({

  /**
   * 页面的初始数据
   */
  data: {

    animationData: '',

    showModalStatus: false,

    // 新楼盘数据
    building_list_hot: [{
        name: "领秀城",
        price: "12000",
        state: "在售",
        src: "https://img1.baidu.com/it/u=2026414630,969097521&fm=11&fmt=auto&gp=0.jpg",
      },
      {
        name: "时代新城",
        price: "15000",
        state: "预售",
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg8.jiwu.com%2Fnewbuildpic%2F22%2F2%2F17678%2F17678548_s.jpg&refer=http%3A%2F%2Fimg8.jiwu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622219641&t=4469578d3512d3401466898edb88b018",
      },
      {
        name: "中央经典城",
        price: "11000",
        state: "售罄",
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zfimg.com%2F2020-09-20%2Fdce9c74a6ee3ad3ca5f07f49500b5929.jpg%40%21240x150&refer=http%3A%2F%2Fpic1.zfimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622219641&t=4081c6d3e84be4e7c86da937ae702d43",
      },
      {
        name: "翡翠郡",
        price: "18000",
        state: "在售",
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zfimg.com%2F2021-03-29%2F2ec79e13fd28737e347ecbc0ee2278c2.jpg%40%21240x150&refer=http%3A%2F%2Fpic1.zfimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622219641&t=7e0b81af93223abb248318fc457b75bc",
      },
      {
        name: "纽伦港小镇",
        price: "9000",
        state: "清盘",
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zfimg.com%2F2020-01-18%2Faeaba18de338cd4c2455d4bd354b859b.jpg%40%21240x150&refer=http%3A%2F%2Fpic1.zfimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622219641&t=7f817174458633d67ae18892a638cca6",
      },
      {
        name: "沂城之门CBD",
        price: "18800",
        state: "预售",
        src: "  https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zfimg.com%2F2020-09-19%2F2dd5822f9d124b441a098692acc20a3e.jpg%40%21240x150&refer=http%3A%2F%2Fpic1.zfimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622223812&t=4e73bb083b83f516f1cb35ac260e729e",
      },

    ],

  },

  checkNewHouseDetail: function (event) {
    wx.navigateTo({
      url: '/pages/inner1/newhousedetail/newhousedetail',
      success: function (res) {
        console.log(res);
      },
      fail: function (res) {
        console.log(res);
      }
    })
  },

  // 隐藏遮罩层
  hideModal: function () {
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(0).step()
    this.setData({
      animationData: animation.export(),
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export(),
        showModalStatus: false
      })
    }.bind(this), 0)
  },

  // 显示
  showModal: function () {
    var y = 200 * utils.getRpx();
    var animation = wx.createAnimation({
      duration: 300,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(-y).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 0)
  },



  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})